/*
 * Author: vdaras
 */

#ifndef PICTURE_H
#define	PICTURE_H

#include "Component.h"
#include "../sdl/Image.h"
#include "../Resource.h"
#if defined(_MSC_VER)
#include <memory>
#else
#include <auto_ptr.h>
#endif

namespace gui
{


/**
 * This class represents a static picture on a user interface.
 */

class Picture : public Component
{
private:
    Resource< sdl::Image >* m_picRes;
    sdl::Image* m_pic;

    
public:

    /**
     * Constrcutor initializes the Component part of the Picture and opens an image
     * located @ path 'picPath'. Then resizes the Component in order to fit the
     * image's size.
     *
     * @param picPath: path of the image on disc
     */

    Picture(const std::string &name, const std::string &picPath);


    /**
     * Constrcutor initializes the Component part of the Picture and opens an image
     * located @ path 'picPath'. Then resizes the Component in order to fit the
     * image's size.
     *
     * @param picPath: path of the image on disc
     */

    Picture(const std::string &name, Container *parent, int x, int y, const std::string &picPath);


    virtual ~Picture();

    
    /**
     * Resizes this Label.
     *
     * @param width: new width.
     * @param height: new height.
     */
    
    virtual void Resize(int width, int height);
    

    /**
     * Draws the picture on a surface.
     *
     * @param target: target surface.
     */

    virtual void Draw(sdl::Surface *target) const;


    /**
     * Updates the picture
     */

    virtual void Update();
};

};

#endif	/* PICTURE_H */

